package com.zheng.damo01.homeWeark;

public class UserTest {
    public static void main(String[] args) {
        User[] userlist=new User[15];
        for (int i = 0; i < userlist.length; i++) {
            userlist[i]=new User(i+1,null);
        }
        Receptionist re=new Receptionist(new fulter() {
            @Override
            public void fulterUser(User user) {
                user.setType("v1");
            }
        });
        Receptionist re1=new Receptionist(new fulter() {
            @Override
            public void fulterUser(User user) {
                user.setType("v2");
            }
        });
        Receptionist re2=new Receptionist((user -> user.setType("v3")));
        for (int i = 0; i < userlist.length; i++) {
            if (i<5){
                re.getFulter().fulterUser(userlist[i]);
            }else if (i<10){
                re1.getFulter().fulterUser(userlist[i]);
            }else {
                re2.getFulter().fulterUser(userlist[i]);
            }

        }

        for (User user : userlist) {
            System.out.println(user);
        }
    }
}
